home *** CD-ROM | disk | FTP | other *** search
/ Stone Design / Stone Design.iso / Stone_Friends / Wave / WavesWorld / Source / IBPalettes / WW3DKit / RIBOption.m < prev    next >
Encoding:
Text File  |  1995-03-22  |  1.6 KB  |  77 lines

  1.  
  2. #import "RIBOption.h"
  3.  
  4. @implementation RIBOption
  5.  
  6. - setName:(RtToken)newName
  7.      n:(int)newN tokens:(RtToken *)newTokens parms:(RtPointer *)newParms archiveVector:(char **)newArchiveVector
  8.      printfTypeVector:(int *)newPrintfTypeVector printfNVector:(int *)newPrintfNVector
  9. {
  10.  
  11.    theName = NXCopyStringBuffer(newName);
  12.    [self setN:newN tokens:newTokens parms:newParms archiveVector:newArchiveVector printfTypeVector:newPrintfTypeVector printfNVector:newPrintfNVector];
  13.    return self;
  14. }
  15.  
  16. - (const char *)theName { return theName; }
  17.  
  18. - renderSelf:(WW3DCamera *)camera startingAt:(RtFloat)shutterOpenTime endingAt:(RtFloat)shutterCloseTime
  19. {
  20.   RiOptionV(theName, n, tokens, parms);
  21.  
  22.   return self;
  23. }
  24.  
  25. - (BOOL)theSameAs:otherRIBCommand
  26. {
  27.   if (strcmp(theName, [otherRIBCommand theName]))
  28.   {  return NO;
  29.   }
  30.   return [super theSameAs:otherRIBCommand];
  31. }
  32.  
  33.  
  34. - writeEve:(NXStream *)stream atTabLevel:(int)tab
  35. {
  36.    int  i;
  37.  
  38.  
  39.    for (i = 0; i < tab; i++)
  40.    {  NXPrintf(stream, "\t");
  41.    }
  42.    NXPrintf(stream, "Option {%s} ", theName);
  43.    [super writeParameterList:stream];
  44.    return self;
  45. }
  46.  
  47. #define typeVector "*"
  48. #define typeValues &theName
  49.  
  50. - read:(NXTypedStream*)stream 
  51. {
  52.     int version;
  53.     [super read:stream];
  54.  
  55.     version = NXTypedStreamClassVersion(stream,"RIBOption");
  56.     if (version == 0) NXReadTypes(stream, "i", &version), version=1;
  57.     if (version == 1)
  58.     {  NXReadTypes(stream, typeVector, typeValues);
  59.     } 
  60.     else 
  61.     {
  62.     }
  63.     return self;
  64. }
  65.  
  66. - write:(NXTypedStream*)stream 
  67. {
  68.     [super write:stream];
  69.  
  70.     NXWriteTypes(stream, typeVector, typeValues);
  71.  
  72.     return self;
  73. }
  74.  
  75.  
  76. @end
  77.